<template>
  <div>
    <mbao-x item1="权限管理" item2="权限列表"></mbao-x>
    <el-card class="Top">
      <el-table :data="table">
        <el-table-column type="index" label="#"> </el-table-column>
        <el-table-column label="权限名称" prop="authName"> </el-table-column>
        <el-table-column label="路径" prop="path"> </el-table-column>
        <el-table-column label="权限等级" prop="level">
          <template slot-scope="scope">
            <div>
              <el-tag v-if="scope.row.level == 0">一级</el-tag>
              <el-tag type="success" v-if="scope.row.level == 1">二级</el-tag>
              <el-tag type="info" v-if="scope.row.level == 2">三级</el-tag>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import MbaoX from '../components/MbaoX.vue'
export default {
  components: {
    MbaoX
  },
  data() {
    return {
      table: []
    }
  },
  created() {
    this.getlist()
  },
  mounted() {},
  methods: {
    async getlist() {
      const res = await this.$http.AllRole('list')
      this.table = res
      console.log(res)
    }
  }
}
</script>
<style scoped lang='scss'>
.Top {
  margin: 20px;
}
</style>
